package com.qpx.springbootdemo1;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.qpx.springbootdemo1.entity.User;
import com.qpx.springbootdemo1.service.IUserService;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.List;

@SpringBootApplication
@MapperScan(basePackages={"com.qpx.springbootdemo1.mapper"})
@EnableScheduling
public class SpringbootDemo1Application implements CommandLineRunner {


    Logger logger = LoggerFactory.getLogger(SpringbootDemo1Application.class);

    public static void main(String[] args) {
        SpringApplication.run(SpringbootDemo1Application.class, args);
    }


    @Autowired
    IUserService userService;

    @Override
    public void run(String... args) throws Exception {
//        User user = new User();
//        Wrapper<User>  wrapper = new EntityWrapper<User>(user);
//        List<User> users = userService.selectList(wrapper);
//        logger.info("项目启动成功后查询所用用户列表：{}",JSON.toJSONString(users));
    }
}
